package cloud.ben.smallscalepigfarmmanagementsystem.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

import java.util.ArrayList;

/**
 * @Author: Ben
 * @Date: 2022/3/1 22:23
 */
@Configuration
@EnableOpenApi
@EnableKnife4j
public class SwaggerConfig {
    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(apiInfo())
                .select()
                .build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfo(
                "小型规模化猪场管理系统",
                "小型规模化猪场管理系统接口文档",
                "v1.0",
                "#",
                new Contact("测试", "#", "814640860@qq.com"),
                "Apache 2.0",
                "#",
                new ArrayList<>());
    }
}

